package pl.edu.mimuw.mas.editor.listener;

import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import pl.edu.mimuw.mas.editor.NewChartDialog;

/**
 * Implementacja Listenera dla okna dialogowego
 * do tworzenia nowych map.
 */
public class CreateChartButtonListener implements SelectionListener {
	private final Logger log = LoggerFactory.getLogger(getClass());

	public final NewChartDialog dialog;
	
	public CreateChartButtonListener(NewChartDialog dialog) {
		this.dialog = dialog;
	}
	
	public void widgetSelected(SelectionEvent event) {
		log.debug("Wybrano");
		dialog.createAndSetChart();
		log.debug("Zamykam okno dialogowe");
		dialog.closeShell();
	}

	public void widgetDefaultSelected(SelectionEvent event) {	}
}
